﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using ConstructionBidOnline.Biz;

public partial class Buyer_BuyerMasterPage : System.Web.UI.MasterPage
{
    #region Event Handlers

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("../sessionexpire.aspx");
            }
            else
            {
                RegisteredUser BuyerObj = RegisteredUser.GetUserByUserName(Session["username"].ToString());
                Session["currentuserid"] = BuyerObj.RegisteredUserID;
                lblusername.Text = BuyerObj.UserName;
                JobCollection JobCollectionObj = Job.GetJobByUserID(BuyerObj.RegisteredUserID);
                if (JobCollectionObj.Count > 0)
                    lblprojectpostedcount.Text = JobCollectionObj.Count.ToString();
                else
                    lblprojectpostedcount.Text = "0";
            }
        }
    }

    #endregion
}
